package model;

import javax.sound.midi.InvalidMidiDataException;
import library.*;

public class ExpressFactory extends CueFactory {
	/**
	 * newCueInfo[0] = CUE TYPE		
	 * newCueInfo[1] = LABEL
	 * newCueInfo[2] = JMIDI CUE NUMBER
	 * newCueInfo[3] = MSC TYPE
	 * newCueInfo[4] = MSC CUE NUMBER
	 * newCueInfo[5] = MSC COMMAND
	 **/
	@Override
	public Cue build(String[] info) {
		ExpressQ cue = new ExpressQ(info[1]);
		cue.setNum(Integer.parseInt(info[2]));
		try {
			cue.setMessage(Integer.parseInt(info[4]));
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvalidMidiDataException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return cue;
	}

}
